﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using Flicks315.Data.Model;


namespace Flicks315.Data
{
    public static class Seeder
    {
        public static void Seed(FlicksDbContext db)
        {
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            
            // Add Movies
            db.Movies.AddOrUpdate(
                m => new {m.MovieId, m.Title, m.Rating, m.Description},
                new Movie() {MovieId=2, Title="MadMax Thunderdome", Rating="PG", Description="Lorum ipsum dolor" },
                new Movie() {MovieId=3, Title="Bambi", Rating="R", Description="Hunting 101" },
                new Movie() {MovieId=4, Title="Whiplash", Rating="G", Description="Motivatioanl music movie" }
                );

            db.Actors.AddOrUpdate(
                a => new {a.ActorId, a.Name, a.Awards, a.MovieId },
                new Actor() {ActorId=1, Name="Tina Turner", Awards=5, MovieId=2 },
                new Actor() {ActorId=2, Name="Mel Gibson", Awards=1, MovieId=2 },
                new Actor() {ActorId=3, Name="Thumper", Awards=9, MovieId=3 },
                new Actor() {ActorId=4, Name="Miles Simons", Awards=3, MovieId=4 }

                );


        }

    }
}
